<?php
header('P3P: CP="CAO PSA OUR"');
header("Content-type: text/html; charset=UTF-8");

$start_time = microtime(true);
session_set_cookie_params(( 3600 * 24 * 7), "/" );
session_cache_expire(60000);
//ini_set("session.gc_maxlifetime", 2073600); 
//ini_set('session.cookie_lifetime', 2073600); 
//ini_set('session.save_handler', 'memcache');
//ini_set('session.save_path', 'tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15');
session_start();
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", 1);

include("config.php");
include("core/core.config.php");
include("core/core.config.controller.php");
include("core/core.origin.php");
// Папка всех контроллеров
include("core/core.controller.php");
// Утилиты движка
//Сам движок
include("core/core.php");
core::setup();
core::execController();
if( core::$isAjax ){
	switch($_REQUEST["ajax"]){
		case(1):
			//echo Utils::json_fix_cyr(json_encode(core::getContent()));
			echo Utils::json_fix_cyr(json_encode(core::getContent()));
		break;
		default:
			
			$cont = core::getContent();
			echo $cont["error"];
	}
}else{
	
	echo core::getContent();	
}

//MPD::send();

?>
